package com.sync.data.ievent.entity;


import com.sync.data.base.BaseEntity;
import com.sync.data.common.annotation.FieldProps;
import com.sync.data.common.annotation.FieldType;
import com.sync.data.common.annotation.RenderType;
import com.sync.data.common.obj.annoation.ObjectPrefix;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 账号
 * @author liquanchang
 */
@Entity
@Getter
@Setter
@ObjectPrefix("tyru")
@Table(name = "sys_user")
public class IeventSysUser extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    public static final String ALIAS = "alias";


    @FieldProps(type = FieldType.STRING, label = "姓名", renderType = RenderType.Input)
    public String realname;

    @FieldProps(type = FieldType.STRING, label = "系统用户名", renderType = RenderType.Input)
    public String username;

    @FieldProps(type = FieldType.STRING, label = "密码", display = false, renderType = RenderType.Input)
    public String password;

    @FieldProps(type = FieldType.STRING, label = "盐", display = false, renderType = RenderType.Input)
    public String salt;

    @FieldProps(type = FieldType.STRING, label = "头像", display = false)
    public String avatar;



    @FieldProps(type = FieldType.STRING, label = "员工号", renderType = RenderType.Input)
    public String workNo;

    @FieldProps(type = FieldType.STRING, label = "手机号")
    public String phone;

    @FieldProps(type = FieldType.STRING, label = "系统角色", sourceObject = "CoreProfile", renderField = "profile", renderType = RenderType.SourcePicker)
    public String profileField;

    @FieldProps(type = FieldType.STRING, label = "email", renderType = RenderType.Input)
    public String email;

    @FieldProps(type = FieldType.DATE, label = "入职时间", renderType = RenderType.DatePicker)
    public Date hireDate;

    @FieldProps(type = FieldType.DATE, label = "离职时间", renderType = RenderType.DatePicker)
    public Date resignationDate;

    @FieldProps(type = FieldType.STRING, label = "账号语言", renderType = RenderType.DatePicker)
    public String language;

    @FieldProps(type = FieldType.STRING, label = "federationId")
    public String federationId;



    @FieldProps(type = FieldType.STRING,label = "外键ID")
    private String externalId;

    @FieldProps(type = FieldType.STRING,label = "企微账号同步状态")
    private Integer activitiSync;

    @FieldProps(type = FieldType.STRING,label = "删除状态")
    private Integer delFlag;


    @FieldProps(type = FieldType.STRING,label = "身份（1普通成员 2上级）")
    private Integer userIdentity;


    @FieldProps(type = FieldType.STRING, label = "代理人")
    public String proxyUserId;

    @FieldProps(type = FieldType.STRING, label = "委托人")
    public String principalUserId;

    @FieldProps(type = FieldType.STRING, label = "禁用原因")
    public String disableReason;

    @FieldProps(type = FieldType.STRING, label = "source")
    public String source;


    /** 是否有 superset sso权限 1是 0否 */
    @FieldProps(type = FieldType.NUMBER, label = "superset权限标识")
    private Integer supersetSsoFlag;

    /** superset 角色 多角色以逗号分割 */
    @FieldProps(type = FieldType.STRING, label = "superset角色标识")
    private String supersetRole;




}
